﻿@model List<SuperiorModel.Api_OrderListModel>
@{
    ViewBag.Title = "我的订单";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var spid = Request["spid"];
    var said = Request["said"];
    var canBack = Request["canback"];
    var orderStatus = Request["orderStatus"];
}
<style>
    * {
        touch-action: pan-y;
    } 
</style>
@if (canBack == null)
{
    <header class="wy-header" style="position:fixed; top:0; left:0; right:0; z-index:200;">
        <div class="wy-header-icon-back"><a href="/Home/Index?spid=@spid&said=@said"><span></span></a></div>
        <div class="wy-header-title">回到首页</div>
    </header>
}

    <div class='weui-content' LoadRequstCount="@Model.Count">
        <div class="weui-tab">
            <div class="weui-navbar" style="position:fixed; top:@(canBack==null?44:0)px; left:0; right:0; height:44px; background:#fff;">
                <a class="weui-navbar__item proinfo-tab-tit font-14 @(orderStatus=="999"?"weui-bar__item--on":"") " href="javascript:void(0);" Os="999">全部</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14 @(orderStatus=="0"?"weui-bar__item--on":"") " href="javascript:void(0);" Os="0">待付款</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14 @(orderStatus=="1"?"weui-bar__item--on":"") " href="javascript:void(0);" Os="1">已发货</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14 @(orderStatus=="3"?"weui-bar__item--on":"") " href="javascript:void(0);" Os="3">待发货</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14 @(orderStatus=="2"?"weui-bar__item--on":"") " href="javascript:void(0);" Os="2">失败</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14 @(orderStatus=="4"?"weui-bar__item--on":"") " href="javascript:void(0);" Os="4">售后</a>
            </div>
            <div class="weui-tab__bd proinfo-tab-con" style="padding-top:@(canBack==null?62:20)px;">
                <div id="list_div" class="weui-tab__bd-item weui-tab__bd-item--active">
                    @foreach (var item in Model)
                    {
                        <div class="weui-panel weui-panel_access">
                            <div class="weui-panel__hd">
                                <span>单号：@item.OrderNo</span><span class="ord-status-txt-ts fr">@ViewHelper.ConvertOrderStatus(item.OrderStatus)</span>
                            </div>
                            <div class="weui-media-box__bd  pd-10">
                                <div class="weui-media-box_appmsg ord-pro-list">
                                    <div class="weui-media-box__hd">
                                        <a href="/Product/Detail?spid=@spid&said=@said&id=@item.ProductId"><img class="weui-media-box__thumb" src="@item.ImagePath" alt=""></a>
                                    </div>
                                    <div class="weui-media-box__bd">
                                        <h1 class="weui-media-box__desc"><a href="/Product/Detail?spid=@spid&said=@said&id=@item.ProductId" class="ord-pro-link">@item.ProductName</a></h1>
                                       
                                        <p class="weui-media-box__desc">规格:<span>@(item.ProppetyCombineName==""?item.ProductName:item.ProppetyCombineName)</span></p>
                                        <div class="clear mg-t-10">
                                            <div class="wy-pro-pri fl">¥<em class="num font-15">@item.SalePrice</em></div>
                                            <div class="pro-amount fr"><span class="font-13">数量×<em class="name">@item.BuyNum</em></span></div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div class="ord-statistics">
                                <span>共<em class="num">@item.ProductNum</em>件商品，</span>
                                <span class="wy-pro-pri">总金额：¥<em class="num font-15">@item.RealityAmount</em></span>

                            </div>

                            <div class="weui-panel__ft">
                                <div class="weui-cell weui-cell_access weui-cell_link oder-opt-btnbox">
                                  
                                    @switch (item.OrderStatus)
                                    {
                                        case 0:
                                            <a href="javascript:;"  OrderNo="@item.OrderNo" class="ords-btn-dele goPayClass">去付款</a>
                                            break;
                                        case 1:
                                            <a href="javascript:;" OrderId="@item.OrderID" class="ords-btn-dele goServiceClass">申请售后</a>
                                            break;
                                    }
                                    <a href="/Order/Detail?orderId=@item.OrderID&spid=@spid&said=@said" class="ords-btn-dele">查看详情</a>
                                    @if (item.OrderStatus == 1 && item.CommentId == 0)
                                    {
                                        <a href="/Comment/Add?orderId=@item.OrderID&spid=@spid&said=@said" class="ords-btn-dele">去评价</a>
                                    }

                                </div>
                            </div>
                        </div>
                    }


                </div>

            </div>
        </div>
        <div class="weui-loadmore" style="display:none">
            <i class="weui-loading"></i>
            <span class="weui-loadmore__tips">正在加载</span>
        </div>
    </div>
    <script src="~/scripts/Order/MyOrders.js?v=213"></script>
<script>
    MyOrdersClass.Instance.Init();
</script>
